package cn.ickck.law_paper_final.provider;

import cn.ickck.law_paper_final.model.entity.HouseLoanBatch;
import org.apache.ibatis.jdbc.SQL;

/**
 * @Author: ck
 * @Description: 房贷批次更新
 * @Date: Create in 12:22 2020/11/7
 */
public class HouseLoanBatchProvider {

    public String updateHouseLoanBatch(HouseLoanBatch houseLoanBatch)
    {
        return new SQL()
        {
            {
                UPDATE("house_loan_batch");
                if(houseLoanBatch.getName()!=null)
                {
                    SET("name = #{name}");
                }
                if(houseLoanBatch.getDate()!=null)
                {
                    SET("date = #{date}");

                }
                if(houseLoanBatch.getKey()!=null)
                {
                    SET("key = #{key}");

                }

                WHERE("id = #{id}");


            }
        }.toString();

    }
}
